home *** CD-ROM | disk | FTP | other *** search
- global gTargetList, gHistory, gEyeBallChan, gVioConChan, gAlertChan, gRearViewChan, gCarByeSnd, gCarHiSnd
-
- on honkHorn arg
- global gOldVol
- if arg then
- set gOldVol to the volume of sound 1
- sound fadeIn 1, 6
- set the volume of sound 1 to 50
- puppetSound("BellTone")
- updateStage()
- else
- sound fadeOut 1, 2
- updateStage()
- puppetSound(0)
- end if
- end
-
- on doMap arg
- global gTopButton, gButtonInks, gFoldChan, gOldTempo, gTopCheck, gBigMapChan, gBottomButton, gTerrainChan, gThisOne
- if not arg then
- set gFoldChan to the clickOn
- allSprites(-1, 1, gVioConChan - 1, gVioConChan)
- set the visible of sprite gFoldChan to 0
- set the visible of sprite gBigMapChan to 1
- updateStage()
- puppetSprite(gVioConChan, 1)
- set gBottomButton to gTopButton + count(gTargetList) - 1
- allSprites(0, 1, gTopButton, gBottomButton)
- allSprites(-1, 0, gTopCheck, gBottomButton)
- updateStage()
- set gOldTempo to the frameTempo
- puppetTempo(2)
- repeat with i in gTerrainChan
- set the visible of sprite i to 0
- end repeat
- exit
- else
- if integerp(arg) then
- set gThisOne to arg - gTopButton + 1
- allSprites(0, 0, gBigMapChan, gTopCheck + count(gTargetList) - 1)
- set the visible of sprite gFoldChan to 1
- updateStage()
- puppetTempo(gOldTempo)
- setTargetPage(gThisOne)
- exit
- else
- if arg = "configure" then
- if not gTopButton then
- repeat with i = 1 to 48
- if the castNum of sprite i = the number of member "mapMarker" then
- set gTopButton to i
- exit repeat
- end if
- set gTopButton to 0
- end repeat
- repeat with j = i to 48
- if the castNum of sprite j <> the number of member "mapMarker" then
- set gTopCheck to j
- exit repeat
- end if
- set gTopCheck to 0
- end repeat
- end if
- if gTopCheck then
- repeat with k = gTopButton to gTopCheck + count(gTargetList) - 1
- set the visible of sprite k to 0
- end repeat
- updateStage()
- end if
- else
- if arg = "animate" then
- if gTopCheck then
- repeat with l = gTopCheck to gTopCheck + count(gTargetList) - 1
- if getPos(gHistory, getAt(gTargetList, l - gTopCheck + 1)) then
- set the visible of sprite l to 1
- next repeat
- end if
- set the visible of sprite l to 0
- end repeat
- updateStage()
- end if
- end if
- end if
- end if
- end if
- end
-
- on hideRearView
- global gSegStart, gNextRandTime, oldVol
- puppetSound(0)
- set the volume of sound 1 to 255
- set oldVol to the volume of sound 1
- set the volume of sound 1 to 70
- puppetSound(gCarByeSnd)
- set fadeDur to 60
- sound fadeOut 1, fadeDur
- updateStage()
- set the castNum of sprite gRearViewChan to the number of member "rv-b"
- updateStage()
- WaitForTicks(20)
- set the visible of sprite gRearViewChan to 0
- puppetSprite(gRearViewChan, 0)
- updateStage()
- set gSegStart to the ticks
- set gNextRandTime to 600 + random(800)
- end
-
- on animateRearView
- global gShowTime, gSegStart, gNextRandTime, gBeepRand, oldVol
- puppetSound(0)
- if the visible of sprite gRearViewChan = 0 then
- set the volume of sound 1 to 255
- set oldVol to the volume of sound 1
- set the volume of sound 1 to 75
- puppetSprite(gRearViewChan, 1)
- set the castNum of sprite gRearViewChan to the number of member "rv-b"
- set the visible of sprite gRearViewChan to 1
- puppetSound("honk")
- updateStage()
- WaitForTicks(5)
- puppetSound("honk")
- updateStage()
- set gShowTime to the ticks
- repeat while soundBusy(1)
- if the mouseDown then
- exit repeat
- end if
- end repeat
- set the castNum of sprite gRearViewChan to the number of member "rv"
- updateStage()
- else
- if not gShowTime then
- set gShowTime to the ticks
- end if
- if (the ticks - gShowTime) > (300 + (random(60) * 10)) then
- if the castNum of sprite gRearViewChan <> the number of member "rv-lTilt" then
- set the castNum of sprite gRearViewChan to the castNum of sprite gRearViewChan + 1
- puppetSound("honk")
- updateStage()
- WaitForTicks(12)
- puppetSound("honk")
- updateStage()
- repeat while soundBusy(1)
- if the mouseDown then
- exit repeat
- end if
- end repeat
- WaitForTicks(10 + random(50))
- else
- hideRearView()
- updateStage()
- set gShowTime to the ticks
- return 1
- end if
- end if
- end if
- end
-
- on followEyes
- repeat with i = gEyeBallChan to gEyeBallChan + 1
- set realAngle to integer(getFollowAngle(i) / 60)
- set nextCast to string(realAngle) & "i"
- if not (the castNum of sprite i = the number of member nextCast) then
- set the castNum of sprite i to the number of member nextCast
- end if
- end repeat
- updateStage()
- end
-
- on checkMapRolz
- global gTopButton, gBottomButton
- repeat with i = gTopButton to gBottomButton
- if rollOver(i) then
- if the castNum of sprite gVioConChan <> (41 + i - gTopButton) then
- set the castNum of sprite gVioConChan to 41 + i - gTopButton
- updateStage()
- end if
- exit
- end if
- end repeat
- end
-
- on warn
- global returnDown
- puppetSound(0)
- allSprites(-1, 1, getAt(gAlertChan, 1), getLast(gAlertChan))
- updateStage()
- set rVal to 1
- repeat while 1
- if the key = RETURN then
- set rVal to 1
- exit repeat
- end if
- if the mouseDown then
- if rollOver(getAt(gAlertChan, 2)) then
- set rVal to 1
- exit repeat
- next repeat
- end if
- if rollOver(getAt(gAlertChan, 3)) then
- set rVal to 0
- exit repeat
- next repeat
- end if
- nothing()
- end if
- end repeat
- set the ink of sprite (getAt(gAlertChan, 2) + not rVal) to 6
- updateStage()
- WaitForTicks(8)
- set the ink of sprite (getAt(gAlertChan, 2) + not rVal) to 8
- allSprites(-1, 0, getAt(gAlertChan, 1), getLast(gAlertChan))
- return rVal
- end
-
- on keyDown
- global returnDown
- if the key = RETURN then
- set returnDown to 1
- end if
- pass()
- end
-
- on keyUp
- global returnDown
- if returnDown then
- set returnDown to 0
- end if
- pass()
- end
-